<?php
/**
 * @version			$Id$
 * @author			Richard Asp
 * @package			Joomla
 * @subpackage		gnudoor
 * @copyright		(C) 2010 gnudoor LLC
 * @license      GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.view');

class GnudoorViewAppointments extends JView
{
    function display($tpl = null)
    {
		global $timezones;
		$model =& $this->getModel('Appointments');
		$timeslots = JRequest::getVar('timeslots');

		if (JRequest::getVar('layout') == "create") {
			//prep specific stuff for creation of appt
			$this->assignRef('reqdate',JRequest::getVar('date'));
			$this->assignRef('reqslot',JRequest::getVar('slot'));
			$this->assignRef('treatments',JRequest::getVar('treatments'));
		}
		
		if (JRequest::getVar('dateparam')) {
			$this->assignRef('dateparam',JRequest::getVar('dateparam'));
		}
		
		if (JRequest::getVar('calendar_message')) {
			$this->assignRef('calendar_message',$_GET['calendar_message']);
		}
		
		if (JRequest::getVar('create_message')) {
			$this->assignRef('create_message',$_GET['create_message']);
		} else {
			//echo "no create_message";
		}
		
		$this->assignRef('customfields',JRequest::getVar('customfields'));
		$this->assignRef('block_same_day',JRequest::getVar('block_same_day'));
		$this->assignRef('timeslots',$timeslots);
		$this->assignRef('days',JRequest::getVar('days'));
		$this->assignRef('cal',JRequest::getVar('cal'));
		
		$timezone = JRequest::getVar('timezone');
		if (isset($timezone)) {
			date_default_timezone_set(JRequest::getVar('timezone'));
		}
		$this->assignRef('now',date_create());
        
		parent::display($tpl);
    }
}


?>